import React, { Component } from "react";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";

/* class Home extends Component {
  render() {
    return <div>主页内容</div>;
  }
} */

function Home(props) {
  console.log(props);
  return <h1>home 页面 {props.match.params.id}</h1>;
}

class App extends Component {
  render() {
    return (
      <Router>
        <Link to="/Home/666">主页</Link>
        {/* exact 精确匹配 */}
        <Route path="/Home/:id" exact component={Home}></Route>
      </Router>
    );
  }
}

export default App;
